package com.example.test.dialogfactory;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import easier.app.x.file.AppFileManager;
import java.io.File;

public class MainActivity47 extends AppCompatActivity {

    private TextView mText0;
    private TextView mText1;
    private TextView mText2;
    private TextView mText3;
    private TextView mText4;

    public static void start( Context context ) {

        Intent starter = new Intent( context, MainActivity47.class );
        context.startActivity( starter );
    }

    @Override
    protected void onCreate( Bundle savedInstanceState ) {

        super.onCreate( savedInstanceState );
        setContentView( R.layout.activity_main47 );
        initView();
        initViewAction();
    }

    private void initView() {

        mText0 = (TextView) findViewById( R.id.text0 );
        mText1 = (TextView) findViewById( R.id.text1 );
        mText2 = (TextView) findViewById( R.id.text2 );
        mText3 = (TextView) findViewById( R.id.text3 );
        mText4 = (TextView) findViewById( R.id.text4 );
    }

    private void initViewAction() {

        String name = "test.data";
        File file = AppFileManager.cacheFile( this, name );
        mText0.setText( file.getAbsolutePath() );

        File file1 = AppFileManager.file( this, name );
        mText1.setText( file1.getAbsolutePath() );

        File file2 = AppFileManager.externalCacheFile( this, name );
        mText2.setText( file2.getAbsolutePath() );

        File file3 = AppFileManager.externalFilesFile( this, Environment.DIRECTORY_DOCUMENTS, name );
        mText3.setText( file3.getAbsolutePath() );

        File file4 = AppFileManager.externalFilesFile( this, name );
        mText4.setText( file4.getAbsolutePath() );
    }
}